<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>找回密码</title>
		<link rel="stylesheet" href="css/login.css" />
		<link rel="stylesheet" href="css/ali/font_508934_kve4so1x2xs10pb9.css" />
		<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
		<script src="js/jquery.min.js"></script>
		<script src="js/login.js"></script>
		<script src="js/register.js"></script>
		
		<script>
			$server = 'http://localhost:8080/';
			function checkUserName(){
				$username = $('#ipUserName').val();
				$.ajax({
					url: $server + 'user/check_user_valid.do',
					type: 'POST',
					datatype: 'json',
					data: {username: $username},
					corssDomain: true,
					xhrFields:{
						withCredentials: true // 携带跨域cookie
					},
					success: function(result){
						console.log(result);
						if (result.code == 200){
							window.location.href= encodeURI('forgetPassword.html?username='+$username);
						}else{
							alert(result.msg);
						}
					},
					error: function(XMLHttpRequest, textStatus, errorThrown){
						alert(textStatus);
					}
				});
			}
		</script>
	</head>
	<body>
		<div class="top">
			<div class="top_logo">
				<img src="img/login_logo.jpg" />
			</div>
			<div class="top_line"></div>
		</div>
		<div class="main0">
			<div class="main">
				<div class="input-group" style="width: 300px; margin: 0 auto;">
					<span class="input-group-addon">用户名</span>
					<input id="ipUserName" type="text" class="form-control"/>
					<span class="input-group-btn">
						<button class="btn btn-default" type="button" onclick="checkUserName()">校验</button>
					</span>
				</div>
			</div>
		</div>
		<div class="footer">Copyright &copy 2019 Bowen University . 桂ICP备888888888号</div>
	</body>
</html>
